home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / BDOS2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  402 b   |  15 lines

  1. /* bdos2.c  --- p554 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. #define DOS_KBDIN 1
  5. #define DOS_DISPCHAR 2
  6. main()
  7. {
  8.     unsigned int ch_read;
  9.             /* First read a character. (see BDOS example) */
  10.     ch_read = bdos(DOS_KBDIN, 0, 0) & 0xff;
  11.             /* Now display the character. DX is the charater.
  12.              * Nothing is needed in AL. */
  13.     printf("\nHere's what you typed: ");
  14.     bdos(DOS_DISPCHAR, ch_read, 0);
  15. }